πŸ•ΈοΈ Ada Research Browser

linkedin_api_setup.md
← Back

LinkedIn API Setup Guide

Step 1: Create a LinkedIn App

  1. Go to LinkedIn Developer Portal
  2. Click "Create app"
  3. Fill in the form:
  4. App name: CMMC Watch Monitor
  5. LinkedIn Page: Your personal LinkedIn page (or create a company page)
  6. App logo: Upload any image (512x512px recommended)
  7. Legal agreement: Check the box
  8. Click "Create app"

Step 2: Configure Products

  1. In your app dashboard, go to the "Products" tab
  2. Request access to:
  3. βœ… "Sign In with LinkedIn using OpenID Connect" (usually instant approval)
  4. βœ… "Share on LinkedIn" (usually instant approval)
  5. ⏳ "Marketing Developer Platform" (may require review - this gives you access to Organization Posts)

Note: For personal profiles, you may need "Marketing Developer Platform" access, which requires LinkedIn review (can take 1-2 weeks). For company pages, "Share on LinkedIn" may be sufficient.

Step 3: Get Your Credentials

  1. Go to the "Auth" tab
  2. Copy these values:
  3. Client ID: 78xxxxxxxxxxxxx
  4. Client Secret: xxxxxxxxxxxx
  5. Add Redirect URLs:
  6. Add: http://localhost:8888/callback
  7. Add: https://cmmcwatch.com/callback (if deploying)

Step 4: Add Credentials to .env

# LinkedIn API (Official)
LINKEDIN_CLIENT_ID=your_client_id_here
LINKEDIN_CLIENT_SECRET=your_client_secret_here
LINKEDIN_ACCESS_TOKEN=  # Will be generated by oauth script
LINKEDIN_REFRESH_TOKEN=  # Will be generated by oauth script

Step 5: Run OAuth Flow

cd scripts
python3 linkedin_oauth.py

This will: 1. Open a browser window for LinkedIn authorization 2. Redirect you to localhost:8888/callback after authorization 3. Automatically extract and save your access token to .env

Step 6: Test the API

python3 linkedin_fetch.py --test

Should output your recent LinkedIn posts.

Step 7: Integrate into Pipeline

Once working, the daily trend collector will automatically use linkedin_fetch.py instead of Apify.


Troubleshooting

"access_denied" Error

"Invalid redirect_uri"

"Expired token"

Can't Access Profile Posts


API Limits (Free Tier)

Much better than Apify's $5-50/month! πŸŽ‰